| macro | isunordered(x,y) |
|---|
| function | bool isunordered (float x , float y);bool isunordered (double x , double y);bool isunordered (long double x, long double y); |
|---|
true. In no case the function raises a FE_INVALID exception.int value. The type of both x and y shall be float, double or long double.bool value.true (1) if either x or y is NaN.false (0) otherwise.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* isunordered example */
#include <stdio.h> /* printf */
#include <math.h> /* isunordered, sqrt */
int main ()
{
double result;
result = sqrt (-1.0);
if (isunordered(result,0.0))
printf ("sqrt(-1.0) and 0.0 cannot be ordered");
else
printf ("sqrt(-1.0) and 0.0 can be ordered");
return 0;
}
sqrt(-1.0) and 0.0 cannot be ordered